Method and apparatus for binding user interface objects to application objects

ABSTRACT

A graphical user interface (GUI) and accompanying functionality for binding Web page definitional elements to a back-end state (e.g., client- or server-side back-end state) and custom logic is provided. In one embodiment, a template containing definitional elements, custom logic, and bindings are generated that define all or a portion of a Web page based on input received and functionality provided by the invention.

BACKGROUND OF THE INVENTION

[0001] 1. FIELD OF THE INVENTION

[0002] This invention relates to binding user interface objects toapplication objects.

[0003] 2. Background Art

[0004] Developing software applications to be used on the Internet isdifficult and complex. There is a need for tools to make it easier for asoftware developer to create such applications. The problem indeveloping Internet applications can be understood by examining theInternet and current tools for creating programs.

[0005] The Internet is a worldwide network of interconnected computers.An Internet client accesses a computer on the network via an Internetprovider. An Internet provider is an organization that provides a client(e.g., an individual or other organization) with access to the Internet(via analog telephone line or Integrated Services Digital Network line,for example). A client can, for example, download a file from or send anelectronic mail message to another computer/client using the Internet.An Intranet is an internal corporate or organizational network that usesthe same communications protocols as the Internet.

Internet Access

[0006] The World Wide Web (WWW) facilitates access to the Internet usingseveral protocols including the Hypertext Transfer Protocol (HTTP). TheWWW can be used to access text and other forms of information such asgraphics, pictures, and sound. Components of the WWW include browsersoftware, network links, and servers. The browser software, or browser,is a user-friendly interface (i.e., front-end) that simplifies access tothe Internet. A browser allows a client to communicate a request withouthaving to learn a complicated command syntax, for example. A browsertypically provides a graphical user interface (GUI) for displayinginformation and receiving input. Examples of browsers currentlyavailable include Netscape's Navigator Gold 3.0 and Microsoft's InternetExplorer.

[0007] Information servers provide information on the WWW in response toa client request. Hypertext Transport Protocol (HTTP) is a standardprotocol for communication with an information server on the WWW. HTTPprovides communication methods that allow clients to request data from aserver and send information to the server.

HTML Definitional Language

[0008] A browser displays information to a client/user as pages ordocuments. The Hypertext Markup Language (HTML) is used to define theformat for a page to be displayed on the WWW. A WWW page is transmittedto a client as an HTML document. The browser executing at the clientparses the document and generates and displays a page based on theinformation specified in the HTML document.

[0009] HTML is a structural language that is comprised of HTML elementsthat are nested within each other. An HTML document is a text file inwhich certain strings of characters, called tags, mark regions of thedocument and assign special meaning to them. These regions are calledHTML elements. Each element has a name, or tag. Examples of elementsinclude unordered lists, text boxes, check boxes, and radio buttons.Each of these elements can have attributes that specify properties ofthe element such as name, type, and value. The following provides anexample of the structure of an HTML document: <HTML> <HEAD> ....element(s) valid in the document head </HEAD> <BODY> .... element(s)valid in the document body </BODY> </HTML>

[0010] Each HTML element is delimited by the pair of characters “<” and“>”. The name of the HTML element is contained within the delimitingcharacters. The combination of the name and delimiting characters isreferred to as a marker, or tag. Each element is identified by itsmarker. In most cases, each element has a start and ending marker. Theending marker is identified by the inclusion of an another character,“/” that follows the “<” character.

[0011] HTML is a hierarchical language. With the exception of the mainHTML element which encompasses the entire HTML document, all otherelements are contained within another element. The HTML elementencompasses the entire document. The main HTML element identifies theenclosed text as an HTML document. The HEAD element is contained withinthe main HTML element and includes information about the HTML document.The BODY element is contained within the main HTML element. The BODYelement contains all of the text and other information to be displayed.Other HTML elements are described in an HTML reference manual such asScharf, D., HTML. Visual Quick Reference, Que Corporation (1995).

[0012] Mechanisms exist for developing Web applications that allow auser to interact with an application running on a remote processor asthough the user's computer terminal was hardwired to the remoteprocessor. That is, traditional networked applications are being portedto the Internet to allow remote access to the application via theInternet. The WebObjects product from NeXT Software, Inc. is an exampleof a set of tools that can be used to develop and run Web applications.

[0013] An application can be ported to the Web by creating HTMLdefinitions for the application's user interface. A Web applicationexhibits a back-end state (e.g., stored data, runtime data, and logic).The HTML definitions that are used primarily for the application's userinterface must be dynamic to reflect the changing back-end state. Theback-end state must be able to be bound to the HTML definitions suchthat the application's logic can dynamically generate (or modify) theHTML definitions. The WebObjects product provides the ability to definethe bindings in a plain text, or ASCII, file. The application developerwrites a set of statements in a text file that are interpreted todetermine the bindings. There is, however, no tool that provides anenvironment for interactively defining the bindings using a graphicaluser interface (GUI) and for generating the binding statements.

[0014] HTML allows hypertext links to be embedded in an HTML documentthat allow a user to interactively initiate transactions at servercomputers via the WWW. Minimal state information about such transactionsis retained within an HTML document. It would be beneficial to useobject-oriented HTML elements to manage a series of transactions and tomaintain state information across transactions. It would be beneficialto be able to generate HTML documents dynamically using information froma previous transaction, corporate data, and data retained in HTMLelement objects. It would be beneficial to be able to share applicationdevelopment across applications.

[0015] As described more fully in United States Patent Applicationentitled Method and Apparatus for Generating Object-Oriented World WideWeb Pages, Ser. No. 08/515,057, filed on Aug. 14, 1995, assigned to theassignee of the present invention, and incorporated herein by reference,a capability exists for generating and manipulating WWW pagesprogrammatically using object classes in an object-oriented environment.Classes of objects are defined for each HTML element. Properties of anHTML element are stored in instance variables of an object class. Anobject class can include methods to manipulate an HTML element. Forexample, an object class can include a method for generating the HTMLfor the element in a Web page definition.

Component

[0016] Self-contained modules, or components, are described in UnitedStates Patent Application entitled Method and Apparatus for Developingand Managing Transactions, Ser. No. 08/532,491, filed on Sep. 22, 1995,assigned to the assignee of the present invention, and incorporatedherein by reference. Such a component can be used in one or more Webpages across multiple applications to provide definition for the Webpage. A component can represent an entire page or some portion of apage.

[0017] Resources such as a template, association, and custom logic canbe associated with a component. An HTML template, for example, canprovide a layout or description of the Web page. An HTML template caninclude some or all of the HTML definition for the Web page, forexample. The template can further identify a dynamic element that can beused to generate the definition for an HTML element. Like an HTMLelement specification in an HTML document, a dynamic element isidentified using a tag. The dynamic element's entry in the template canfurther specify attributes for an instance of the object class.

[0018] Custom logic can be a program written in a script, Objective C,or other programming language that can be used to generate and control aWeb page at runtime. For example, custom logic can generate an HTMLdefinition for a requested Web page using an HTML template together witha runtime, or back-end, state of a client or server process. Thus,certain portions of the Web page can be defined prior to runtime whileother portions are dynamically created at runtime.

[0019] Associations of a component can be used to provide a bindingbetween the definitional elements (e.g., HTML elements) included in aWeb page specification (e.g., HTML definition file) and the back-endstate of a client or server process. For example, a text or ASCII filecan be created using a text editor that contains statements thatassociate attributes of an HTML element with variables declared in thecustom logic. Currently, a WWW application developer must specify theseassociations by writing statements using a declarative language syntaxsuch as value=employee.fn where value is an attribute of an HTMLelement, employee is the variable and fn is a field of the employeevariable. In the prior art, there is no mechanism for graphicallyspecifying or viewing bindings between a Web page definition and customlogic.

SUMMARY OF THE INVENTION

[0020] A graphical user interface (GUI) and accompanying functionalityfor binding Web page definitional elements to a back-end state (e.g.,client- or server-side back-end state) and custom logic is provided. Atemplate containing definitional elements, custom logic, and bindings isgenerated that defines all or a portion of a Web page.

[0021] The GUI is used to define the layout of a Web page. Definitionalelements (e.g., HTML elements) are specified for inclusion in the Webpage. A set of variables and methods are defined using the invention.Variables have associated classes that are used to determine a defaultbinding. Bindings between the definitional elements and the variablesand methods is performed using the invention.

[0022] A definitional element can be bound to a variable, method orconstant. A default binding can be determined between the definitionalelement and a variable based on the class of the variable. Thedefinitional element's attribute that is used in the binding can bedetermined based on the variable's class. Certain attributes of adefinitional element can be bound to a method or constant.

[0023] To bind a definitional element and a back-end state item, adefinitional element is selected from the GUI. A back-end state item(e.g., variable, constant or method) is selected from the GUI eitherfrom a list of all items or a list of possible items. A default bindingis determined between an attribute of the definitional element and theback-end state item. The default binding is displayed in the GUI forviewing by the user. In most cases, the attribute of the definitionalelement that is bound to the back-end state item can be displayed in thegraphic representation of the definitional element. Since more than oneattribute of a definitional element can be bound to the back-end state,the attribute that is fundamental to specifying the definitional elementis displayed in the GUI. For example, the attribute that contains thevalue of a string or identifies the variable that stores a text field'sinput provides information that is fundamental to the specification ofthe string and text field definitional elements. A default binding isdetermined for a fundamental attribute of the definitional element andis displayed in the GUI. The user can change a default or other bindingusing an input screen referred to as an inspector. The inspector hasinput fields that can be used to input the definitional element,back-end state item and/or attribute to use in the binding. Theinspector can be used to add arbitrary back-end state items in additionto the default bindings.

[0024] The invention can be used to bind a definitional element to datacontained in a database. A display group object used as a controller forenterprise objects can be bound to definitional elements in the Webpage. Thus, data can be retrieved from one or more tables in a databaseand used to dynamically generate a Web page. Further, data can beretrieved from a Web page received from a Web application user andstored in the database.

BRIEF DESCRIPTION OF THE DRAWINGS

[0025]FIG. 1 provides an example of a general purpose computer that canbe used with the present invention.

[0026]FIG. 2 provides an functional overview of an embodiment of theinvention.

[0027]FIG. 3 provides an overview of the screens used in a GUI accordingto an embodiment of the invention.

[0028]FIG. 4A provides an example of an application window according toan embodiment of the invention.

[0029]FIG. 4B provides an example of a palette containing HTML elementsaccording to an embodiment of the invention.

[0030]FIG. 4C provides an example of usage of a form-based dynamicelement palette according to an embodiment of the invention.

[0031]FIG. 4D provides an example of an inspector window with bindingsdisplayed according to an embodiment of the invention.

[0032]FIG. 5 provides an example of a component window according to anembodiment of the invention.

[0033]FIG. 6 provides an example of an object browser window containingvariables and methods for a component.

[0034]FIG. 7 provides an example of a graphical user interface screenused in a binding operation.

[0035]FIG. 8A provides an example of a definitional element sectioncontaining definitional elements according to one embodiment of theinvention.

[0036]FIG. 8B illustrates variables and definitional elements in a guestapplication according to one embodiment of the invention.

[0037]FIG. 8C displays examples of bindings according to an embodimentof the invention.

[0038] FIGS. 9A-9B provide a binding process flow according to anembodiment of the invention.

[0039]FIG. 10 provides an example of binding definitional elements to adatabase table according to an embodiment of the invention.

DETAILED DESCRIPTION OF THE INVENTION

[0040] A method and apparatus for binding user interface objects toapplication objects is described. In the following description, numerousspecific details are set forth in order to provide a more thoroughdescription of the present invention. It will be apparent, however, toone skilled in the art, that the present invention may be practicedwithout these specific details. In other instances, well-known featureshave not been described in detail so as not to obscure the invention.

[0041] The present invention can be implemented on a general purposecomputer such as illustrated in FIG. 1. A keyboard 110, mouse 111 andI/O 119 are coupled to a bi-directional system bus 118. The keyboard andmouse are for introducing user input to the computer system andcommunicating that user input to CPU 113. The computer system of FIG. 1also includes a video memory 114, main memory 115 and mass storage 112,all coupled to bi-directional system bus 118 along with keyboard 110,mouse 111 and CPU 113. The mass storage 112 may include both fixed andremovable media, such as magnetic, optical or magnetic optical storagesystems or any other available mass storage technology. Bus 118 maycontain, for example, 32 address lines for addressing video memory 114or main memory 115. The system bus 118 also includes, for example, a32-bit DATA bus for transferring DATA between and among the components,such as CPU 113, main memory 115, video memory 114 and mass storage 112.Alternatively, multiplexed DATA/address lines may be used instead ofseparate DATA and address lines.

[0042] In the preferred embodiment of this invention, the CPU 113 is a32-bit microprocessor manufactured by Motorola, such as the 680×0 orPower PC processor or a microprocessor manufactured by Intel, such asthe 80×86, or Pentium processor. However, any other suitablemicroprocessor or microcomputer may be utilized. Main memory 115 iscomprised of dynamic random access memory (DRAM). Video memory 114 is adual-ported video random access memory. One port of the video memory 114is coupled to video amplifier 116. The video amplifier 116 is used todrive the cathode ray tube (CRT) raster monitor 117. Video amplifier 116is well known in the art and may be implemented by any suitable means.This circuitry converts pixel DATA stored in video memory 114 to araster signal suitable for use by monitor 117. Monitor 117 is a type ofmonitor suitable for displaying graphic images.

[0043] The computer system described above is for purposes of exampleonly. The invention may be implemented in any type of computer system orprogramming or processing environment.

[0044] The invention provides a mechanism for binding Web pagedefinitional elements to a runtime, or back-end, state using a graphicaluser interface (GUI). The GUI includes functionality to specify and viewa Web page definition including definitional elements, back-end state ofa client or server process, and bindings between the two. Functionalityis provided for displaying a set of potential, default bindings usingselections made by the GUI user (e.g., a Web application developer).Bindings can be made between definitional elements and elements of adatabase using the invention. Dynamic Web pages can be generated usingdata retrieved from a database. Further, input received from a Web pagecan be stored in a database.

[0045]FIG. 2 provides an functional overview of an embodiment of theinvention. Web page 202 contains fields such as input fields 204 and 206and button field 208. Page 202 is displayed using a browser such as, forexample, Netscape's Navigator browser or Microsoft's Internet Explorer.A browser displays page 202 from a definition such as definition 212.Definition 212 contains definitional elements (e.g., HTML elements) thatare used by a browser to generate page 202. For example, element 214contains a definition for input field 204. Element 214 specifiesattributes for input field 204 such as the type of input (“TYPE=‘TEXT’”)and size of the field (i.e., “SIZE=‘20’”). The default value for field204 is determined at runtime from back-end state 210. Elements 216 and218 contain definitional information for fields 206 and 208.

[0046] Attributes of HTML elements 214-218 can be specified prior toruntime (e.g., statically defined). Other attributes may be defined atruntime from information contained in back-end state 210. Back-end state210 includes data and logic such as variable 234, constant 236 andmethod 238. Attributes 224-228 are attributes of dynamic elements usedto generate HTML elements. For example, attribute 224 is an attribute ofa dynamic element that generates HTML element 214. HTML element 214 isthe HTML definition for field 204. Attribute 224 is bound to variable234 in back-end state 210. Variable 234 contains the default value thatis displayed in field 204. Similarly, constant 236 is used to determinea size for input field 206, and method 238 provides an action that isperformed when a submit input is received.

[0047] The invention is used to bind, or map, the back-end state to thedefinitional attributes. A binding is a mapping between one aspect of adynamic element in a definition (e.g., an attribute) and the back-endstate. A dynamic element is an element that is replaced with dynamicallygenerated HTML at runtime. For a dynamic element to be fully functional,it must be bound to the back-end state. Bindings 244-248 bind, or map,elements 214-218 to back-end state 210. Input element 214 is bound (viabinding 244) to variable 234. Binding 246 binds input element 216 toconstant 236. Method 238 is bound (via binding 248) to input element218.

[0048] The invention's functionality is used to create and managebindings 244-248. A GUI is provided that is used to create, delete andmodify bindings. FIG. 3 provides an overview of the screens used in aGUI according to an embodiment of the invention. The GUI is used togenerate template 330, declarations 332 and script 334.

[0049] The GUI includes application window 302 that is used to controlapplication-wide resources. It is used to open, create, or deletecomponents inside an application as well as to define variables withglobal scope (e.g., application- and session-level variables). Atruntime, application-level variables are created when an applicationstarts executing and are deallocated when the application quits. Asession-level variable is created when a new user begins a new sessionand is deallocated when the session ends. Application- and session-levelvariables can be accessed by an application's components.Component-level variables exist while the dynamic pieces of thecomponent are being evaluated. After the component's page is redrawn,the back-end state contained in a component-level variable is lost.

[0050]FIG. 4A provides an example of an application window according toan embodiment of the invention. Application window 472 includes tabs474, 476, and 478 to allow a user to select the level at which toperform functions. By selecting tab 474, functions are performed at thecomponent level. When tab 474 is selected, a list of components (lines480A-480G) is displayed to select a component upon which operations canbe performed. Components can be added, deleted, modified and viewed.Application-level and session-level functions can be performed byselecting tabs 476 and 478, respectively. For example, it is possible toadd, delete, modify or view application- or session-level variables byselecting tabs 476 or 478.

[0051] Multiple application windows can be opened at the same time inthe GUI. For example, two instances of application window 472 can beopened that correspond to two different applications, application A andapplication B. A component that is used in application A can be reusedin application B by selecting and dragging the component's graphicalrepresentation from application A's application window to applicationB's application window. The component is copied into application B. Thecomponent's HTML template, declarations, and script are copied intoapplication B's directory. Further, a graphical-representation of thecomponent is displayed in application B's application window. Thus, acomponent that has already been defined in one application can be reusedin another application using the GUI.

[0052] In the preferred embodiment, a component is reused without theneed to copy it to an application's directory. Instead, a component canbe shared that is placed in a location that is known to allapplications. Thus, any application can access the component in thatlocation. There is no need to copy the component to an application'sdirectory. Multiple applications can share the same component (a portionof a component such as a template). Changes can be made to a single copyof the component. There is no need to update multiple copies of acomponent.

[0053] Referring to FIG. 3, object browser 312 is used to create, deleteand modify application-, session-, and component-level variables. Whenit is used at the component-level, object browser 312 displays the fullinterface provided by a script file. Those items that are fully definedin the script file (e.g., a method that is filled out or a completevariable declaration) are displayed in object browser 312. Objectbrowser 312 is used to bind dynamic elements to variables or methods ina script. Object browser 312 can also be used to display the interfacesof application- and session-level script files.

[0054] Component window 304, reached by selecting component table 474and selecting or creating a component, provides an interface forcreating, editing, and viewing a component. For example, componentwindow 304 is used to add definitional elements, variables and methodsto a component. Script window 306 shows a component's custom logic(e.g., a script or Java program). The contents of script window 306 canvary depending on the current definition level (e.g., application,session, and component). If application window 302 is open to define theapplication, script window 306 displays an application-level script.Similarly, if the session is being defined, script window 306 displays asession script. When component window 304 is open, script window 306contains the component's script. The GUI includes an inspector window310 that is used to display and modify binding, attributes and othersettings.

[0055] Palette 308 contains elements that can be dragged into anotherwindow. For example, palettes 308 can include a window that contains acollection of definitional elements (e.g., HTML elements) that can bedragged and dropped into a component displayed in component window 304.FIG. 4B provides an example of a palette containing definitionalelements according to an embodiment of the invention.

[0056] Icons 402, 404 and 406 represent different palette views that canbe opened by, for example, clicking the icon. Icon 402 represents astatic elements palette that contains static definitional elements.Static elements are elements that remain constant (i.e., are notmodified at runtime). Icons 410-422 are examples of HTML staticelements. Icon 410 represents a heading HTML element. The paragraph,list, HTML block, horizontal line, table, and link tags are representedby icons 412-422.

[0057] Dynamic elements can be displayed by selecting icons 404 and 406,respectively. Icon 404 represents form-based dynamic elements. Aform-based dynamic element is an element that has an equivalent staticelement in the definitional language (e.g., has an HTML elementequivalent). Icon 404 represents definitional elements such as HTMLelements that can be defined or modified at runtime. A dynamic elementis replaced or modified with dynamically generated definitionalstatements (e.g., HTML statements) at runtime. For example, a stringelement can be added to the definition of a page prior to runtime whosevalue will be determined at runtime. A static element can be transformedinto a dynamic element by creating a binding for the element. If nobinding is created, a static element (e.g., a static form-based element) is created. Preferably, when a binding is defined for a form-basedelement, an object class that is associated with the element is used tomanipulate the element at runtime. For example, when a binding isdefined for a text field, a textField object is created to provideattributes and behavior for the text field element at runtime.

[0058]FIG. 4C provides an example of a form-based dynamic elementpalette according to an embodiment of the invention. Icon 440 isselected to display palette window 444. Palette window 444 includesicons 450-456 that represent elements that can be dragged (e.g., indirection 442) from palette window 444 and dropped into another window(e.g., component window 446) to create a definitional element (e.g.,HTML form element). HTML language statements are generated for theelement.

[0059] Referring to FIG. 4B, icon 406 is used to open an abstractdynamic elements palette. An abstract dynamic element is an element thatdoes not have a direct equivalent in the Web page definitional language.At runtime, an abstract element can be replaced by text or graphics oranother definitional construct. A palette window can be opened to selectan abstract element by selecting icon 406, for example. In addition tothe static, form-based and abstract element palettes, it is possible tocreate custom palettes or to access a pre-existing custom palette.

[0060] The GUI is used to specify an initial definition and custom logicfor Web page 202 and bindings between the two. In one embodiment, theinitial definition is in the form of a text file (e.g., template 330)that contains a set of definitional statements such as HTML statementsthat identify an initial layout for Web page 202. Script 334 containslogic that can be executed at runtime. Script 334 can be defined using ascripting or compiled language, for example. Declarations 332 contains aset of bindings that associate elements specified in template 330 withthe logic contained in script 334.

Component Window

[0061] Component window 304 provides an interface for creating, editing,or viewing a component. For example, the interface can be used to addHTML elements, variables, and methods to a component. FIG. 5 provides anexample of a component window according to an embodiment of theinvention.

[0062] Component window 502 includes a element section 504 and an objectbrowser 506. Element section 504 is used to add, remove, or modifydefinitional elements (e.g., HTML elements) to the component. Asdiscussed above, palette window 308 contains definitional elements thatcan be selected for inclusion in a component. A graphical display of thedefinitional elements is provided in element section 504. Definitionalelements displayed in element section 504 are used to generate template330.

[0063] Object browser 506 is used to display variables or methods. FIG.6 provides an example of an object browser containing variables andmethods for a component. Columns 602, 604, and 608 are used to displayvariables and methods. For example, if object browser 606 is being usedto display component-level information, column 602 contains thecomponent's variables 610 and methods 612. Object browser 606 can alsobe used to display application-level or session-level variables. Aninstance of object browser 606 is displayed when tab 476 or 478 isselected in application window 472, for example. When line 614 ofvariables 610 (available in a component window) is selected, column 604is used to display application-level variables 616. Similarly, if line618 (available in a component window) is selected, session-levelvariables can be displayed in column 604.

[0064] Icons 626, 628, and 630 are used to create or delete a variableor method. For example, icon 630 is used to delete a variable (ormethod). To create a variable or a method, icons 628 and 626,respectively, are selected. The name of the variable (or method) beingcreated is typed into field 620. The script is modified (e.g., variableor method declarations) in script window 306 in response to a create ordelete operation.

[0065] A class can be specified for the variable using field 622 byeither typing in a class or selecting a class from a menu that isdisplayed by pressing button 624. The class of a variable specifies thevariable type. Preferably, a variable is identified as being one ofthree types of classes: base, composite, or enterprise object. A baseclass includes variables that represent or can be translated into asingle value. The base classes are Object, Number, and String. Avariable of the Number class represents a single number, and a variableof the String class represents a single string, for example.

[0066] The composite classes include dictionary and custom classes. Avariable in the Dictionary class could represent all of the informationabout one item. The Enterprise Object classes are used in applicationsthat access a database. A variable of type base, composite or enterpriseobject can also be an array of objects. The objects contained in thearray are of the class selected for the variable. An array variablemight represent a list of items.

Binding Elements

[0067] A binding is a mapping between a variable or method declared in acomponent's script (or other logic such as a function or method) and anattribute of a dynamic definitional element of the component. Eachdynamic definitional element has one or more attributes. Each attributeof a dynamic definitional element can be bound to a variable or methodin a script. It is not necessary to bind all of a dynamic definitionalelement's attributes, however. In one embodiment, the class of avariable is used to determine a default binding.

[0068] The GUI of the invention is used to specify a binding includingspecifying the variable (or method), the dynamic definitional elementand the element's attribute. The invention facilitates binding bydetermining possible attributes of a definitional element for bindingbased on the variable selected. Further, given the definitional elementand a variable, the invention identifies a default binding using anattribute of the definitional element. The variable's class is used tofacilitate the identification of possible attributes of a definitionalelement to bind to the variable.

[0069] To bind a definitional element to a variable, a user:

[0070] 1) selects a definitional element;

[0071] 2) selects a variable (or method); and

[0072] 3) selects an attribute of the selected definitional element tobe bound to the selected variable.

[0073]FIG. 7 provides an example of a graphical user interface screenused in a binding operation. Component window 702 contains definitionalelement section 704 and object browser 706. Definitional element section704 contains field 712 which is a graphical representation of an HTMLINPUT element. An HTML INPUT element includes name and value attributes.The user selects field 712 as the definitional element to be bound.

[0074] Object browser 706 contains a listing of variables (e.g., aGuest)and methods (e.g., submit) that can be selected for binding to the HTMLINPUT element. The variable aGuest is a dictionary composite classvariable that contains the variables: comments, email, and name. Theuser selects the name variable for binding to the HTML INPUT element.Based on this, the value attribute of the HTML INPUT element is bound tothe name variable. The value attribute of the HTML INPUT in thecomponent (i.e., field 712) is bound to the aGuest.name variable in thecomponent's script.

[0075] At runtime, the value attribute of a dynamic element used togenerate the HTML INPUT elements is bound to a variable that containsthe default value for the input field. In field 712, the name field ofthe aGuest variable is used to specify the default value for the HTMLINPUT element in the page in which the component is a part. At runtime,an HTML INPUT statement is generated, or modified, with the valuecontained in aGuest.name.

[0076] A binding is displayed in the GUI for review by the user. Thegraphical representation of the bound definitional element (e.g., field712) identifies the bound variable (e.g., aGuest.name). Message 718 isdisplayed to identify the specific attribute of the definitional elementthat is bound to the variable.

[0077] In the previous example, the user selected the variable to bebound from a display of all variables and methods accessible to thecomponent in the object browser. Alternatively, a pop-up menu can beused to display the possible variables that can be selected based on theselection of the definitional element. The GUI can display a pop-upwindow in the definitional element section that contains the variablesthat can be bound to the definitional element selected by the user. Theuser can select one of the variables contained in the pop-up window. Thevariables are chosen for inclusion in the pop-up menu based on theirclass relative to the definitional element that was selected.

[0078] More than one attribute of a definitional element can be bound tothe back-end state. One or more attributes of a definitional element areconsidered to be fundamental to the definitional element'sspecification. For example, the attribute that contains the value of astring or identifies the variable that stores a text field's inputprovide information that is fundamental to the specification of thestring and text field definitional elements. If a binding is determinedfor a fundamental attribute of the definitional element, it is displayedin the GUI.

[0079] Inspector window 310 can be used to specify the bindinginformation. Inspector window 310 might be used to access an attributeincluding those that are not fundamental to a definitional element'sspecification or to specify a constant, for example. As a result of abinding to a constant declaration, the constant declaration is added tothe bindings file.

[0080]FIG. 4D provides an example of an inspector window with bindingsdisplayed according to an embodiment of the invention. Inspector window490 displays the bindings, attributes, and other settings for thecurrently selected definitional element and other definitional elements.Definitional languages such as HTML are hierarchical languages. Adefinitional element is contained within another definitional element.The hierarchy is displayed in inspector window 490 using icons ashierarchy 492. The icons in hierarchy 492 represent a definitionalelement or a binding for a definitional element. Bindings section 494displays the bindings (i.e., the attribute and a value to which it isbound) for a definitional element. A constant can be bound to anattribute by selecting the attribute, inputting a value in field 496,and pressing connect button 488. A variable can be bound to an attributeby selecting the variable, opening inspector 490, selecting anattribute, and pressing the current variable button 498.

Default Bindings

[0081] In addition to providing a GUI for defining a binding, theinvention provides a mechanism for automatically identifying anddisplaying all of the possible variables that are available for bindingto a definitional element. Further, an attribute, such as a fundamentalattribute, of a definitional element selection can be automaticallyselected for binding with a selected variable. The automaticidentification of a possible variable and/or attribute facilitatesbinding. The user is given those variables that can be bound to thedefinitional element. Further, it is not necessary for the user toselect an attribute for binding to the variable.

[0082] The class of a variable is used in the identification of one ormore attributes for binding. The attributes of a definitional elementare compared with the class associated with a variable in theidentification process. For example, a definitional element that is usedto dynamically generate a string at runtime has a value attribute. Thevalue attribute specifies the text that is to be displayed in the Webpage. A string or other value or object that can be translated into astring would be a valid binding to the value attribute. Variables thathave been defined as being in the base class (i.e., are an object,number or string) are compatible with the value attribute. Thus, thesevariables can be displayed as possible variables for binding with thestring definitional element. Further, if a variable of a base class isselected, the value attribute (a fundamental attribute) of the stringdefinitional element is automatically selected as the default bindingattribute.

Binding Example

[0083] The following binding example is provided to illustrate bindingusing embodiments of the invention. The example assumes anobject-oriented programming environment and the use of HTML as thedefinitional language. However, the capabilities and techniquesillustrated can be applied in other programming environments otherdefinitional languages. The example involves the development of a Webpage for entering and displaying information about users in a guest bookapplication. Users enter the name and email address in the input fieldson a displayed Web page. The entered name and address are retrieved fromthe Web page and added to an array of guests. One guest or all entriesin the guests array can be displayed on one or more Web pages.

[0084] Application window 302 can be used to create a main component forthe Web page. Associated with the main component is an instance of eachof template 330, declarations 332, and script 334. An instance ofcomponent window 304 is opened from application window 302. Since thereis nothing at this point in template 330, the definitional elementsection (e.g., section 504) of component window 304 is initially empty.Instances of palette 308 can be used to drag and drop HTML elements intothe main component.

[0085]FIG. 8A provides an example of a definitional element sectioncontaining definitional elements according to one embodiment of theinvention. A repetition is illustrated between icons 850. The elementswithin icons 850 are repeated for each item in a repetition. Arepetition element is an abstract dynamic element that does not directlycorrespond to an HTML element. A repetition element is used to generateHTML at runtime such as an ordered or unordered HTML list. A repetitionelement includes list attribute 800A and item attribute 800B (theirconnection is illustrated by icon 852). Referring to FIG. 8B, the listattribute identifies the array (e.g., array 832) of objects (e.g.,objects 834A-834D) that repetition element 802 will iterate through. Theitem attribute identifies the current item (e.g., 834A) in the listarray.

[0086] Referring to FIG. 8A, string element 804 and string element 806are dynamic elements that generate HTML display strings at runtime. Asindicated by static text 810 and 812, string elements 804 and 806display a name and an email address. A string element is an abstractdynamic element that generates a text string. Submit element 808 is aform-based element that corresponds to the submit HTML element (i.e., anINPUT HTML element of type submit).

[0087] Variables are created to store back-end state information for theguest book application. FIG. 8B illustrates variables and definitionalelements in the guest book application according to one embodiment ofthe invention. A custom class, guest, is created that is of classdictionary. A dictionary class has some similarity to a C languagestructure with fields. It contains a key (a name of the field) and avalue for a key. The keys for objects of class guest are name and email.An application-level variable, guests (variable 832), is an array ofobjects of class guest that is created, using object browser 312, tostore a list of guests. Object browser 312 is used to create acomponent-level variable, aguest, that is of class guest and storescurrent guest information.

[0088] The GUI is used to create a binding between elements 802-808 andthe variables. To create a binding for repetition element 802, it isfirst selected. A variable, for example variable 832 (guests), isselected for binding to repetition element 802. Since variable 832 is anarray in this embodiment, a default binding 842A is created betweenvariable 832 and repetition element 802 using the list attribute ofrepetition element 802. A second binding, binding 842B, is created usingthe item attribute of repetition element 802 when variable 834A, aguest,and repetition element 802 are selected. Thus, repetition element 802 isbound to two different variables.

[0089] Variable 834A has name and email subfields that bind to stringelements 804 and 806. Binding 844 is created between string element 804and aguest.name (variable.834A) via the value attribute of stringelement 804. String element 806 is bound (binding 846) to aguest.email(variable 834A) via the value attribute of string element 806. Submitelement 808 causes method 838 to be created in the main component'sscript. Method 838 can be viewed and modified using script window 306.For example, method 838 adds the information contained in the variable834A (i.e., aguest variable) to the variable 832 (i.e., guests arrayvariable). A default binding (binding 848) is created between method 838and submit element 808 via its action attribute.

[0090] Bindings 842A-842B and 844-848 are default bindings. That is,they are created automatically given the class of the selected variableand the attributes of the selected element. The name and email subfieldsof variable 834A are of class object (a base class). Default bindingsare created between these subfields and an attribute of string elements804 and 806 that expects a value (i.e., the value attribute). The listattribute of repetition element 802 expects an array variable (e.g.,variable 834A). The item attribute is an element of the list array. Oncethe list attribute is bound to an array of a specific type, the type ofthe item attribute can be determined. For example, when the listattribute is bound to an array of guests, an item attribute is a singleguest. If a single guest is a dictionary variable of composite class(e.g., variable 832), the user can access the fields within thedictionary variable (e.g., name and email fields of the aguestvariable)The action attribute of submit element 808 expects a method(e.g., method 838).

[0091] The bindings that are created are displayed in the GUI. FIG. 8Cdisplays bindings according to an embodiment of the invention. Thegraphical representation of repetition element 802 is updated to begraphical representations 800A and 800B (in FIG. 8B). Graphicalrepresentation 800A reflects the binding of repetition element 802 tothe guests variable (variable 832). Graphical representation 800Bdisplays the binding between repetition element 802 and the aguestvariable (variable 834A). Similarly, the variable names aguest.name andaguest.email are displayed in the GUI for string elements 804 and 806,respectively. The name of a bound method can be displayed in graphicalrepresentation 808.

[0092] At runtime, the information stored in the script variables andthe scripts methods are used to dynamically generate the HTML definitionfor the main component. In a preferred embodiment, the HTML elements areinstantiated as objects whose attributes include the definitionalelement's attributes. The objects' behavior is used to retrieveinformation to generate the Web page using the data stored in the scriptvariables. In addition, the objects' behavior is used to retrieveinformation from the Web page for storage in the script variables. Anobjects' behavior can also be invoked in response to an action is takenin the Web page (e.g., the submit button is depressed).

[0093] Each of the variables or items in array 832 are processed usingrepetition element 802. Referring to FIG. 8B, repetition element 802 isbound to an array 832 and item is bound to a variable which is to be setwith elements from the array (e.g., variable 834A) within array 832.Repetition element 802 advances a pointer to a current item in array832. String element 804 accesses information contained in the currentitem of array 832 to generate or modify an existing HTML definitionusing the data contained in the array item. For example the name fieldof variable 834A is used by string element 804 to generate a namestring. Similarly, the email field of variable 834A is used by stringelement 808 to generate an email string. The name and email strings areadded to the HTML definition of Web page 850. When the HTML definitionis complete, it is sent to the requesting browser for interpretation anddisplay.

[0094] Web page 850 is displayed by the browser. A browser user canreview the name and email information in fields 804 and 806. When Webpage 850 is submitted using submit field 808, bindings 844 and 846 andmethod 838 can be used to store the input in the Web page 850 in thename and email subfields of back-end variable 834.

Binding Flow

[0095] FIGS. 9A-9B provide a binding process flow according to anembodiment of the invention. At step 902, a definitional element isselected by the user. At step 904, the invention identifies theattributes of definitional element. At step 906 (i.e., “selected elementhas attributes and there are possible variables?”), a determination ismade whether the selected definitional element has attributes to bebound and there are possible variables that can be bound to an attributeof the definitional element. If the selected definitional element doesnot have attributes for binding or there are no possible variables thatcan be bound to an attribute, processing continues at step 926 toindicate that there is no suitable default binding and processing endsat step 924.

[0096] If, at step 906, it is determined that there are attributes ofthe definitional element that can be bound to possible variables,processing continues at step 908. At step 908, the variables that can bebound to the definitional element are determined. The possible variablesare displayed for review by the user, for example, in a pop-up menu atstep 910. At step 912, the user selects a variable for binding. At step914, attributes of the definitional element are identified that can bebound to the selected variable. At step 916 (i.e., a single pertinentattribute?”) a determination is made whether there is one fundamentalattribute that matches the selected variable. If there are zero or morethan one such attribute, processing continues at step 926 to indicatethat there is no suitable default binding. The user can elect toidentify the attribute using Inspector 310.

[0097] If it is determined based on the class of the variable that thereis a single pertinent attribute of the definitional element that can bebound to the selected variable, processing continues at step 918. Atstep 918 (i.e., attribute fundamental to element), a determination ismade whether the attribute is a fundamental attribute. If so, processingcontinues at step 920 to display the variable in the GUI to identify itas being bound to the definitional element. If not, processing continuesat step 922. At step 922, a message is displayed to identify thedefinitional element's attribute that was used in the binding.Processing ends at step 924.

[0098] The process flow in FIGS. 9A-9B use a pop-up menu or otherinterface widget to display those variables that can be bound to theselected definitional element. Alternatively, a user can specify abinding using inpsector window 310. In this case, the user selects adefinitional element in step 902 and selects a variable as in step 910.The user selects an attribute of the selected definitional element tobind to the selected variable from inspector window 310.

Database Binding

[0099] In the guest book application, the guests array is populated frominput received from users. A database can be the source of data that isused to populate the guests array. Fields of a database table can bebound to elements of a Web page such that data retrieved from a databaseis displayed in a Web page or data contained in a Web page is stored ina database.

[0100]FIG. 10 provides an example of binding to a database tableaccording to an embodiment of the invention. Table 1012 contains twocolumns, or fields: name and email. Entity 1014 maps table 1012 to anobject class, class 1006. Entity 1014 can be created using a modelingapplication such as the EOModeler modeling application available fromApple Computer, Inc. Entity 1014 maps columns in table 1012 toattributes of class 1006. The mapping information provided by entity1014 includes a mapping between the NAME column of table 1012 and thename attribute of class 1006. Similarly, the EMAIL column of table 1012is mapped to the email attribute of class 1006.

[0101] Entity 1014 is stored as part of the application (e.g., the guestapplication). Data is fetched from table 1012 and stored in instances ofclass 1006. A custom class, called a displayGroup class, can manage fordisplay instances of an object class mapped to the database. Forexample, an instance of the displaygroup class, displayGroup 1020, iscreated to manage for display the instances of class 1006. For example,objects 1008A-1008C are controlled by displaygroup 1020. Objects1008A-1008C are instantiated using data from table 1012. Thus, forexample, objects 1008A-1008C can contain the name and email informationstored in rows 1018A-1018C (respectively) of table 1012. A descriptionof object to databased mapping is provided in the Enterprise ObjectsFramework 2.0 Developer's Guide and is incorporated herein by reference.

[0102] The attributes or instance variables of class 1006 are displayed(e.g., in a component window) and can be bound to a definitional elementas previously discussed. Thus, an attribute of a definitional elementcan be bound to an attribute of an object containing data from a datasource such as a database (e.g., table 1012). As illustrated by line1022, the binding is performed via the displayGroup object instance(e.g., displayGroup 1020).

[0103] The displayGroup class keeps track of all of the objects that itmanages (e.g., allObjects). At runtime, the displaygroup monitors whichobject or objects are currently selected or displayed. A binding can bespecified between an attribute of a definitional element and anattribute of an object class instance that is currently selected orbeing displayed. For example, a binding can be defined between the valueattribute of element 1040 and the name attribute of an object that iscurrently selected (e.g., object 1008B where object 1008B is a selectedobject at runtime). Where displayGroup 1020 is referred to asguestDisplayGroup, the binding can be expressed asguestDisplayGroup.selectedObject.name.

[0104] The application developer can therefore bind dynamic elements ofa Web page to attributes or instance variables of objects that are heldby the displayGroup. In addition, a dynamic element can be bound to amethod of displaygroup 1020. For example, a method of displayGroup 1020such as displayObjects can be bound to a repetition element. Thefollowing provides examples of possible methods of displayGroup 1020grouped by the type of operation they perform:

Display Results Methods

[0105] The “Display Results” methods give access to database objects andallow them to be displayed: allObjects: All of the objects managed fordisplay by displayGroup. displayedObjects: The subset of allObjects.selectedObjects: The objects in the current selection. selectedObject: Asingle selected object.

Managing Batches Methods

[0106] The application developer can specify the number of records thatare displayed on a Web page by setting numberOfObjectsPerBatch. Based onthe numberOfObjectsPerBatch setting, the displayGroup changes the subsetof allobjects for display (i.e., displayedObjects). The size of thesubset is determined by the batch size specified (e.g., by theapplication developer). For example, if the numberOfObjectsPerBatch isset to five, displayedObjects initially identifies the first fiveobjects in the set of allobjects as the displayed objects. ThedisplayNextBatch results in the next five objects of the set ofallObjects being identified as the displayedObjects.

[0107] The following are examples of batch methods displayPreviousBatch:Select the previous batch of objects and then reloads the page.displayNextBatch: Selects the next batch of objects and then reloads thepage. batchCount: The number of batches to display. currentBatchIndex:The number of the batch currently displayed where 1 is the first batchdisplayed. numberOfObjectsPerBatch: The number of objects that can bedisplayed in a Web page.

Query Methods

[0108] The displaygroup object class can be used to construct and invokea query on the information contained in a database. A query-by-exampleinterface is used to specify the query. To construct a query in theguest application, for example, an empty form is displayed that containsa name and email address input field for entering guest information. Atemplate object instance that is not tied to a row in the database isused to store input entered into an input field. The template objectinstance can be thought of as a dictionary of key value pairs.

[0109] The keys or properties of a template object instance are bound toattributes of a definitional element. For example, if a value attributeof a definitional element used to generate an input field of an inputform is bound to a property of a template object such as name and a userenters a value in the field, the user input is stored in the templateobject as name. To construct a query, the displaygroup instance (e.g.,guestDisplayGroup) accesses the information stored in the templateobject to construct a qualifier (e.g., selection criteria) for use inquerying the database (e.g., table 1012).

[0110] Methods of the displaygroup (e.g., inputObjectForQualifier andsecondObjectForQualifier) return a template object to which the userinterface fields can be bound. When either the inputObjectForQualifieror secondObjectForQualifier is selected in object browser 312, theattributes of a template object are displayed (e.g., the name and emailattributes of template object 1050 are displayed wheninputObjectForQualifier is selected). In defining the input form,elements 1040 and 1042 are created as a textField definitional elementsthat generate HTML INPUT fields at runtime.

[0111] Elements 1040 and 1042 are bound to template objects 1050 and1052 via displaygroup 1020. Where displaygroup is namedguestDisplayGroup, the bindings are expressed as (respectively):

[0112] “guestDisplayGroup.inputObjectFor Qualifier.name”

[0113] “guestDisplayGroup.secondtObjectForQualifier name”

[0114] The bindings are shown graphically in FIG. 10. The valueattributes of elements 1040 and 1042 are bound to the name attributes oftemplate objects 1050 and 1052 (respectively). Template objects 1050 and1052 is used to store input entered into an input fields and are nottied to records in table 1012.

[0115] When all query fields having values are only ininputObjectForQualifier (i.e., none in secondObjectForQualifier), aqualifier is constructed using equality or LIKE pattern matching. Forexample, when a value is specified for a name attribute of element 1040,a select statement is generated that includes the clause “wherename=user input.” A pattern such as “%@*” can be specified for thedisplayGroup. The pattern is used to generate the where clause forstring pattern matching. The “%@” portion of the pattern specifies thelocation of the user input and the “*” is a wild card. Thus, the patternis “user input*”. For example, if the user input is Bill, the whereclause that is constructed is using the “%@*” pattern matching is “wherename LIKE Bill*”. Where more than one attribute of a template object hasa value, a where clause is constructed that tests for each attributethat has a value.

[0116] A range (i.e., “from” “to”) can be specified by binding twotemplate objects to two definitional elements. For example,inputObjectForQualifier is bound to one definitional element andsecondObjectForQualifier is bound to a second definitional element.Referring to FIG. 10, element 1040 is bound to a template object 1050and element 1042 is bound to element 1054 via displayGroup 1020. When auser inputs a “from” name using the input field of element 1040, thevalue is stored in template object 1050. A “to” name input using theinput field of element 1042 is stored in template object 1054. TheexecuteQuery method constructs a selection criteria that specifies arange using the “from” and “to” name values. For example, if the nameattributes of template objects 1050 and 1054 contain the values “Jones”and “Smith”, the where clause that is generated is “where name>“Jones”and name <“Smith”.

[0117] The following are examples of methods used to perform queries:executeQuery: Builds a qualifier using inputObjectForQualifier and thepattern matching set in the displayGroup options panel, and fetches therecords that match the qualifier. inputObjectForQualifier: Returns anentity object that is used to create the qualifier.secondObjectForQualifier: Used for from-to queries to specify the “to”value.

Database Modification Methods

[0118] The following are examples of methods used to modify thedatabase: insert: Adds a new empty record. delete: Deletes the selectedrecords.

[0119] A displayGroup is associated with a change tracking object. Thechange tracking object monitors the changes that are made to the data.To perform a commit, the displayGroup instance sends a save request tothe change tracking object. The changed data stored in an object iswritten to the database.

[0120] Thus, a method and apparatus for binding user interface objectsto application objects has been provided.

1. A method for specifying a binding between a user interface element ina Web page and a back-end state of a Web page application using agraphical user interface (GUI) executing in a computer system comprisingthe steps of: displaying in an element palette of said GUI, a HypertextMarkup Language (HTML) user interface element, said HTML user interfaceelement being associated with an object class having a plurality ofattributes and behavior for generating a Hypertext Markup Language(HTML) definition for said HTML user interface element; dragging saidHTML user interface element from said element palette into a firstwindow of said GUI to include said user interface element in thedefinition of a Web page; displaying a graphical representation of saidHTML user interface element in said first window of said GUI; displayingin a second window of said GUI one or more variables of a back-end stateof a Web page application that are compatible with said object class;selecting one of said one or more variables for binding to said objectclass; determining whether there is a single attribute of said objectclass that is fundamental to the definition of said HTML user interfaceelement; performing steps (a)-(c) if said single attribute exists: (a)creating a binding between said single attribute and said one of saidone or more variables; (b) displaying in said graphical representationof said HTML user interface element said one of said one or morevariables; (c) displaying in said GUI the name of said single attribute;and saving said binding as a part of a definition of said Web page.